<template>
  <div class="body">
    <el-button type="info" icon="el-icon-refresh-right"></el-button>
    <el-button type="danger" icon="el-icon-delete">删除</el-button>
    <el-button type="primary" icon="el-icon-upload2">导出</el-button>
    <el-table
      ref="multipleTable"
      :data="applylist"
      tooltip-effect="dark"
      class="table"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column prop="proid" label="序号" width="120">
      </el-table-column>
      <el-table-column prop="bidding_number" label="采购项目编号" width="120">
      </el-table-column>
      <el-table-column prop="bidding_project_number" label="包号" width="120"> </el-table-column>
      <el-table-column
        prop="bidding_project_name"
        label="采购项目名称"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column prop="bidding_type" label="采购方式" width="120">
      </el-table-column>
      <el-table-column prop="bidder_notice_time" label="招标公告发布日期" width="120">
      </el-table-column>
      <el-table-column prop="review_time" label="评审日期" show-overflow-tooltip>
      </el-table-column>
      <el-table-column prop="bidding_name" label="标段名称" width="120">
      </el-table-column>
      <el-table-column prop="margin_amount" label="中标金额" show-overflow-tooltip>
      </el-table-column>
      <el-table-column
        prop="unify_code"
        label="机构信用代码"
		width="120"
      >
      </el-table-column>
      <el-table-column prop="company_name" label="供应商名称" width="120">
      </el-table-column>
      <el-table-column prop="source" label="来源" width="120"> </el-table-column>
      <el-table-column prop="moneysource" label="资金来源" show-overflow-tooltip>
        <template slot-scope="scope">
          {{scope.row.moneysource==0?'资金来源':scope.row.moneysource==1?'自筹资金':'其他自己资金'}}
        </template>
      </el-table-column>
      <el-table-column prop="create_time" label="添加时间" width="120">
      </el-table-column>
      <el-table-column
        prop="status"
        label="是否申请保函"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          {{scope.row.proid}}
          <el-button size="mini" @click="skipRoute(scope.row.proid)">申请保函</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 新增或修改 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="序号">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="项目编号">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="项目名称">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="担保机构名称">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">确定</el-button>
          <el-button @click="cancel">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>

    <div class="block">
       <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :page-sizes="[10,20,30]"
        :page-size="params.limit"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      ></el-pagination>
    </div>
  </div>
</template>

<script>
import { apply } from "@/api/apply";
export default {
  data() {
    return {
      applylist: [
    
      ],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 表单参数
      form: {
        name: "",
      },
      // 表单校验
      rules: {},
      params:{
        limit:10,
        offset:0,
        keywords:'',
      },
      total:null,
      tableData: [
        {
          date: "1",
          name: "101213141516171819",
          address: "河南省安阳生态环境监测中心仪器设备项目",
        },
        {
          date: "1",
          name: "101213141516171819",
          address: "河南省安阳生态环境监测中心仪器设备项目",
        },
        {
          date: "1",
          name: "101213141516171819",
          address: "河南省安阳生态环境监测中心仪器设备项目",
        },
        {
          date: "1",
          name: "101213141516171819",
          address: "河南省安阳生态环境监测中心仪器设备项目",
        },
        {
          date: "1",
          name: "101213141516171819",
          address: "河南省安阳生态环境监测中心仪器设备项目",
        },
        {
          date: "1",
          name: "101213141516171819",
          address: "河南省安阳生态环境监测中心仪器设备项目",
        },
        {
          date: "1",
          name: "101213141516171819",
          address: "河南省安阳生态环境监测中心仪器设备项目",
        },
      ],
      multipleSelection: [],
    };
  },

  created() {
    this.applys();
  },
  methods: {
    //页面
    applys() {
      apply({
        unify_code: "91410105MA3XJM5AX4",proid:'',
      }).then((response) => {
        console.log(response);
        this.applylist = response.data.data.rows;
        this.total = response.data.data.total

      });
    },
    skipRoute(uid) {
      // this.$router.push("/BidSecurity/SelectALot/" + uid);
      this.$router.push({ path: '/BidSecurity/SelectALot/', query: { projectid: uid }})
      
    },
    // 表单重置
    reset() {
      this.form = {
        name: "",
      };
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    //新增按钮操作
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加档案架";
    },
    //修改
    handleUpdate() {
      this.reset();
      this.open = true;
      this.title = "修改档案架";
    },
    //提交按钮
    onSubmit() {
      alert("submit!");
      this.open = false;
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.params.limit = val;
      this.getYaoqing();
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.params.offset = parseInt(val - 1) * this.params.limit;
      this.getYaoqing();
    },
  },
};
</script>

<style scoped>
.body {
  width: 86vw;
  height: 91vh;
}

.table {
  width: 100%;
  margin-top: 2vh;
}

.block {
  position: fixed;
  bottom: 20px;
  right: 20px;
}
</style>
